package textdetection

// TextDetectionRequest represents a text detection request
type TextDetectionRequest struct {
	ImagePath           string  `json:"image_path" binding:"required"`
	OutputDir           string  `json:"output_dir" binding:"required"`
	ConfidenceThreshold float32 `json:"confidence_threshold"`
	SaveRegions         bool    `json:"save_regions"`
}

// BoundingBox represents a bounding box
type BoundingBox struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

// TextRegion represents a detected text region
type TextRegion struct {
	RegionID    string      `json:"region_id"`
	FilePath    string      `json:"file_path"`
	Confidence  float32     `json:"confidence"`
	BoundingBox BoundingBox `json:"bounding_box"`
}

// TextDetectionResponse represents the response
type TextDetectionResponse struct {
	Status           string       `json:"status"`
	RequestID        string       `json:"request_id"`
	ImagePath        string       `json:"image_path"`
	HasText          bool         `json:"has_text"`
	TextRegionsCount int          `json:"text_regions_count"`
	RegionsSaved     bool         `json:"regions_saved"`
	SavedRegions     []TextRegion `json:"saved_regions"`
	ProcessTimeMs    float64      `json:"process_time_ms"`
	Error            string       `json:"error,omitempty"`
	Details          string       `json:"details,omitempty"`
}

// Detection represents a single detection
type Detection struct {
	BBox       BoundingBox
	Confidence float32
}

